package com.frozenc.controller.auth;

import com.frozenc.domain.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.SessionAttributes;
import org.springframework.web.bind.support.SessionStatus;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;

/**
 * Created by FrozenC on 2016/9/9.
 */
@Controller
public class SignOut {
    @RequestMapping(value = "/signout",method = RequestMethod.GET)
    public void Get(HttpServletResponse response, HttpSession httpSession) {
        httpSession.removeAttribute("currUser");
        try {
            response.sendRedirect("/");
        } catch (IOException e) {
            e.printStackTrace();
        }
        return ;
    }
}
